﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
	mc:Ignorable="d"
	x:Class="ControlTutorial"
	d:DesignWidth="640" d:DesignHeight="480">
  <UserControl.Resources>
    <ControlTemplate x:Key="ScrollViewerControlTemplate1" TargetType="{x:Type ScrollViewer}">
      <Grid x:Name="Grid" Background="{TemplateBinding Background}">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="*"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Rectangle x:Name="Corner" Grid.Column="1" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1" Width="0"/>
        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
        <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource ScrollBarStyle1}"/>
        <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
      </Grid>
    </ControlTemplate>
    <Style x:Key="ScrollBarLineButtonStyle" TargetType="{x:Type RepeatButton}">
      <Setter Property="OverridesDefaultStyle" Value="true"/>
      <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
      <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
      <Setter Property="BorderBrush" Value="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"/>
      <Setter Property="BorderThickness" Value="2"/>
      <Setter Property="MinWidth" Value="0"/>
      <Setter Property="MinHeight" Value="0"/>
      <Setter Property="IsTabStop" Value="false"/>
      <Setter Property="Focusable" Value="false"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type RepeatButton}">
            <Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="ClassicBorder" BorderThickness="{TemplateBinding BorderThickness}" BorderStyle="AltRaised" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" BorderBrush="{x:Null}">
              <Path Data="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Microsoft_Windows_Themes:ClassicBorderDecorator>
            <ControlTemplate.Triggers>
              <Trigger Property="IsPressed" Value="true">
                <Setter Property="BorderStyle" TargetName="ClassicBorder" Value="AltPressed"/>
              </Trigger>
              <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <SolidColorBrush x:Key="ScrollBarPageButtonBrush" Color="{StaticResource {x:Static SystemColors.ControlLightLightColorKey}}" Opacity="0.5"/>
    <Style x:Key="VerticalScrollBarPageButtonStyle" TargetType="{x:Type RepeatButton}">
      <Setter Property="OverridesDefaultStyle" Value="true"/>
      <Setter Property="IsTabStop" Value="false"/>
      <Setter Property="Focusable" Value="false"/>
      <Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
      <Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type RepeatButton}">
            <Rectangle x:Name="PageButtonBackground" Fill="Transparent"/>
            <ControlTemplate.Triggers>
              <Trigger Property="IsPressed" Value="true">
                <Setter Property="Fill" TargetName="PageButtonBackground" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Thumb}">
            <Microsoft_Windows_Themes:ClassicBorderDecorator BorderThickness="3" BorderStyle="Raised" Background="#FF7979FF"/>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="HorizontalScrollBarPageButtonStyle" TargetType="{x:Type RepeatButton}">
      <Setter Property="OverridesDefaultStyle" Value="true"/>
      <Setter Property="IsTabStop" Value="false"/>
      <Setter Property="Focusable" Value="false"/>
      <Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
      <Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type RepeatButton}">
            <Rectangle x:Name="PageButtonBackground" Fill="Transparent"/>
            <ControlTemplate.Triggers>
              <Trigger Property="IsPressed" Value="true">
                <Setter Property="Fill" TargetName="PageButtonBackground" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="ScrollBarStyle1" TargetType="{x:Type ScrollBar}">
      <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
      <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
      <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"/>
      <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
      <Setter Property="BorderThickness" Value="0"/>
      <Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
      <Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type ScrollBar}">
            <Grid Width="8">
              <Grid.RowDefinitions>
                <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
                <RowDefinition Height="0.00001*"/>
                <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
              </Grid.RowDefinitions>
              <Viewbox Stretch="Fill">
                <RepeatButton Content="M 0 4 L 7 4 L 3.5 0 Z" Command="{x:Static ScrollBar.LineUpCommand}" Height="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Style="{StaticResource ScrollBarLineButtonStyle}" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}"/>
              </Viewbox>
              <Rectangle Grid.Row="1"/>
              <Track x:Name="PART_Track" IsDirectionReversed="true" Grid.Row="1">
                <Track.DecreaseRepeatButton>
                  <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButtonStyle}"/>
                </Track.DecreaseRepeatButton>
                <Track.IncreaseRepeatButton>
                  <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButtonStyle}"/>
                </Track.IncreaseRepeatButton>
                <Track.Thumb>
                  <Thumb Style="{StaticResource ScrollBarThumb}" Background="#FF7979FF" Foreground="{x:Null}"/>
                </Track.Thumb>
              </Track>
              <Viewbox Grid.Row="2" Stretch="Fill">
                <RepeatButton Content="M 0 0 L 3.5 4 L 7 0 Z" Command="{x:Static ScrollBar.LineDownCommand}" Height="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Style="{StaticResource ScrollBarLineButtonStyle}" Foreground="{x:Null}" BorderBrush="{x:Null}" Background="{x:Null}"/>
              </Viewbox>
            </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Style.Triggers>
        <Trigger Property="Orientation" Value="Horizontal">
          <Setter Property="Width" Value="Auto"/>
          <Setter Property="MinWidth" Value="0"/>
          <Setter Property="Height" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
          <Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type ScrollBar}">
                <Grid Background="{TemplateBinding Background}">
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
                    <ColumnDefinition Width="0.00001*"/>
                    <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
                  </Grid.ColumnDefinitions>
                  <Viewbox Stretch="Fill">
                    <RepeatButton Content="M 0 4 L 4 8 L 4 0 Z" Command="{x:Static ScrollBar.LineLeftCommand}" MinHeight="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}" Style="{StaticResource ScrollBarLineButtonStyle}" Width="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
                  </Viewbox>
                  <Rectangle Grid.Column="1" Fill="{StaticResource ScrollBarPageButtonBrush}"/>
                  <Track x:Name="PART_Track" Grid.Column="1">
                    <Track.DecreaseRepeatButton>
                      <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButtonStyle}"/>
                    </Track.DecreaseRepeatButton>
                    <Track.IncreaseRepeatButton>
                      <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButtonStyle}"/>
                    </Track.IncreaseRepeatButton>
                    <Track.Thumb>
                      <Thumb Style="{StaticResource ScrollBarThumb}"/>
                    </Track.Thumb>
                  </Track>
                  <Viewbox Grid.Column="2" Stretch="Fill">
                    <RepeatButton Content="M 0 0 L 0 8 L 4 4 Z" Command="{x:Static ScrollBar.LineRightCommand}" MinHeight="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}" Style="{StaticResource ScrollBarLineButtonStyle}" Width="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
                  </Viewbox>
                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Trigger>
      </Style.Triggers>
    </Style>
  </UserControl.Resources>

  <Grid>
    <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Template="{DynamicResource ScrollViewerControlTemplate1}">
      <TextBlock x:Name="__Text" TextWrapping="WrapWithOverflow" Foreground="White" FontSize="13.333" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Visible">
        <Run Text="The Enhancements.Basic.Expressions namespace contains types that altogether provide you with a way to compile and solve text-based expressions. The best analogy I can think of for this tool is Excel's formula solving - in Excel you put a formula in a cell (pretty much some text) and Excel parses it, analyzes it, and solves it."/>
        <LineBreak/>
        <Run Text="This namespace, this tool, does exactly that, but it's programmer-oriented, open and free to use."/>
        <LineBreak/>
        <Run Text=""/>
        <LineBreak/>
        <Bold>
          <Run Text="You start off by:"/>
        </Bold>
        <LineBreak/>
        <Run Text="    1. Creating a Compiler instance, stating the functions allowed to be used by the expressions;"/>
        <LineBreak/>
        <Run Text="    2. Call the Compile method passing in an expression. The compiler will assert the expression correctness and will return an Expression instance;"/>
        <LineBreak/>
        <Run Text="    3. You call the returned Expression instance Solve method. It will calculate the result and return it to you;"/>
        <LineBreak/>
        <Run Text="    4. To solve the same expression again, you don't have to re-Compile, but just call Solve again. This remains true even if the expression has variables (explained later)."/>
        <LineBreak/>
        <Run Text=""/>
        <LineBreak/>
        <Bold>
          <Run Text="To fully understand the following explanations, first memorize the following:"/>
        </Bold>
        <LineBreak/>
        <Run Text="    A. The expressions are considered in a case-insensitive fashion;"/>
        <LineBreak/>
        <Run Text="    B. White-space is supported, thus making "/>
        <Run Text=" "/>
        <Run Text="&quot;1 + 1&quot; equal to &quot;1+1&quot;;"/>
        <LineBreak/>
        <Run Text="    C. Level nesting is supported allowing you to write expressions such as:"/>
        <LineBreak/>
        <Run Text="        33 * (1 + 2)"/>
        <LineBreak/>
        <Run Text="        Exponentiate(Add(5*7+(3-5),29),2)"/>
        <LineBreak/>
        <Run Text="    "/>
        <LineBreak/>
        <Bold>
          <Run Text="This tool supports a fixed set of data types and each, of course, has a right way of being written."/>
        </Bold>
        <LineBreak/>
        <Underline>
          <Run Text="    Boolean:"/>
        </Underline>
        <LineBreak/>
        <Run Text="        Valid writings:"/>
        <LineBreak/>
        <Run Text="            True"/>
        <LineBreak/>
        <Run Text="            False"/>
        <LineBreak/>
        <Underline>
          <Run Text="    Integer:"/>
        </Underline>
        <LineBreak/>
        <Run Text="        Numeric values with no fractional part"/>
        <LineBreak/>
        <Run Text="        Range from zero to System.Int64.MaxValue"/>
        <LineBreak/>
        <Run Text="        Valid writings:"/>
        <LineBreak/>
        <Run Text="            0"/>
        <LineBreak/>
        <Run Text="            1"/>
        <LineBreak/>
        <Run Text="            12987348321"/>
        <LineBreak/>
        <Run Text="        Please remember that negative values are obtained only through usage of the Negative function, but as that function itself uses the Minus operator, negative values can be written normally:"/>
        <LineBreak/>
        <Run Text="            -1"/>
        <LineBreak/>
        <Run Text="            -12987348321"/>
        <LineBreak/>
        <Underline>
          <Run Text="    Decimal:"/>
        </Underline>
        <LineBreak/>
        <Run Text="        Numeric values with or without fractional part"/>
        <LineBreak/>
        <Run Text="        Range from zero to System.Decimal.MaxValue"/>
        <LineBreak/>
        <Run Text="        The fractional part separator is always the dot and if no fractional part is intended, it can be overlooked"/>
        <LineBreak/>
        <Run Text="        Every decimal value writing must end with D"/>
        <LineBreak/>
        <Run Text="        Valid writings:"/>
        <LineBreak/>
        <Run Text="            0.D"/>
        <LineBreak/>
        <Run Text="            0D"/>
        <LineBreak/>
        <Run Text="            0.0000001D"/>
        <LineBreak/>
        <Run Text="            12987348321.00001D"/>
        <LineBreak/>
        <Run Text="        Please remember that negative values are obtained only through usage of the Negative function, but as that function itself uses the Minus operator, negative values can be written normally:"/>
        <LineBreak/>
        <Run Text="            -0.D"/>
        <LineBreak/>
        <Run Text="            -0D"/>
        <LineBreak/>
        <Run Text="            -0.0000001D"/>
        <LineBreak/>
        <Run Text="            -12987348321.00001D"/>
        <LineBreak/>
        <Underline>
          <Run Text="    DateTime:"/>
        </Underline>
        <LineBreak/>
        <Run Text="        Date and time values"/>
        <LineBreak/>
        <Run Text="        Range from 01-Jan-0001 0:0:0.000 to System.DateTime.MaxValue"/>
        <LineBreak/>
        <Run Text="        These values must be enclosed by #"/>
        <LineBreak/>
        <Run Text="        A DateTime value, in order to be accepted by the tool, it must be written according to one of three regular expressions. As regexs are hard to explain, here are valid values for each of the regexs:"/>
        <LineBreak/>
        <Run Text="            #2011-12-25#"/>
        <LineBreak/>
        <Run Text="            #2011-12-25 01:25:34#"/>
        <LineBreak/>
        <Run Text="            #2011-12-25 01:25:34.986#"/>
        <LineBreak/>
        <Run Text="        The writing order is always: year month day hour minute second millisecond"/>
        <LineBreak/>
        <Run Text="        When using the simpler two regexs, the unspecified time parts default to zeros"/>
        <LineBreak/>
        <Underline>
          <Run Text="    String:"/>
        </Underline>
        <LineBreak/>
        <Run Text="        Textual values"/>
        <LineBreak/>
        <Run Text="        The acceptable lengths range from 0 to System.Int32.MaxValue"/>
        <LineBreak/>
        <Run Text="        These values must be enclosed by "/>
        <Run Text=" "/>
        <Run Text="&quot; (quotes)"/>
        <LineBreak/>
        <Run Text="        Valid writings:"/>
        <LineBreak/>
        <Run Text="            &quot;&quot;"/>
        <LineBreak/>
        <Run Text="            &quot;hello!&quot;"/>
        <LineBreak/>
        <Run Text="        Special characters in the ASCII 0-127 range, can be written by using escape sequences, and an escape sequence is written using the \xxx format, where \ is the sequence prefix, and xxx is the 3-digit mandatory ASCII code. So, you can specify a space by using \032, but not using \32 ."/>
        <LineBreak/>
        <Run Text="        Also, to specify the \ character, you must write \\ ." />
        <LineBreak/>
        <Run Text="        More valid writings:"/>
        <LineBreak/>
        <Run Text="            &quot;hello\032people!&quot;"/>
        <LineBreak/>
        <Run Text="            &quot;c:\\users\\moi\\friends.dat&quot;"/>
        <LineBreak/>
        <Run Text=""/>
        <LineBreak/>
        <Bold>
          <Run Text="Function syntax and operator syntax:"/>
        </Bold>
        <LineBreak/>
        <Run Text="    Any expression-based framework should aim for expressions writing simplicity, just as in Excel or as in any inexpensive calculator."/>
        <LineBreak/>
        <Run Text="    Still, this framework is based on functions and functions signatures, and as such, theoretically, for you to write a simple &quot;1+1&quot; expression, you would have to write &quot;Add(1,1)&quot; , which could, considering more complex scenarios, come down to stuff like &quot;Add(Add(Add(1,1),1),1)&quot; for a yet simple &quot;1+1+1+1&quot; . "/>
        <LineBreak/>
        <Run Text="    This kind of writing, which I call function syntax writing, is possible and supported, but it requires the user to know the names of the functions even for basic tasks, and, still, gives him a lot of writing work to do. It's unnatural and prone to errors."/>
        <LineBreak/>
        <Run Text="    So, this tool also supports operator syntax, enabling you to write &quot;1+1+1+1&quot; while the system itself translates it to &quot;Add(Add(Add(1,1),1),1)&quot; ."/>
        <LineBreak/>
        <Run Text="    How does it works? It's simple!"/>
        <LineBreak/>
        <Run Text="    Each function can have an associated operator and when that happens, operator syntax is possible for that function. In the previous examples, the Add function is associated with the Plus operator."/>
        <LineBreak/>
        <Run Text="    As the supported operators are hard-coded, a long set has been integrated into the framework and each, please note, just comprise a string representation and nothing more. Its strength is given by the association each function makes with a specific operator."/>
        <LineBreak/>
        <Run Text="    Also note that this tool only supports unary and binary operators and thus, for a function to be called using operator syntax, all its signatures must have one or two parameters tops."/>
        <LineBreak/>
        <Run Text=""/>
        <LineBreak/>
        <Bold>
        <Run Text="Operators supported:"/>
        </Bold>
        <LineBreak/>
        <Run x:Name="__OperatorsSupported"/>
        <LineBreak/>
        <Bold>
        <Run Text="Functions:"/>
        </Bold>
        <LineBreak/>
        <Run Text="    At the core of this tool are functions, as they are the sole entities that actually do some work, processing some inputs and returning a single output."/>
        <LineBreak/>
        <Run Text="    Each function has the following characteristics:"/>
        <LineBreak/>
        <Run Text="        Name: all functions used by a compiler must have valid and different names;"/>
        <LineBreak/>
        <Run Text="        Operator association: optional. When specified, the operator class and operator priority must be stated. This priority is a number that tells the system the priority this function-to-operator association will have when several function-to-operator associations are found in a level of an expression. For simplicity consider simple Math: multiply before adding."/>
        <LineBreak/>
        <Run Text="        Signatures: each function has one or more. It tells the system how the function can be called (parameters types) and what data type will return. For simplicity, face this as normal .Net function overloading."/>
        <LineBreak/>
        <Run Text="    Also note that you can, while instantiating Compiler, indicate that no built-in functions will be made available to the compiler, just yours!"/>
        <LineBreak/>
        <Run Text="    The tool already comes with built-in functions that were properly tested but you can create new ones easily. Check this Tutorial's code for the creation process."/>
        <LineBreak/>
        <LineBreak/>
        <Bold>
          <Run Text="Built-in functions, along with their signatures:"/>
        </Bold>
        <LineBreak/>
        <Run x:Name="__BuiltinFunctions"/>
        <LineBreak/>
        <Bold>
        <Run Text="The compilation process, and Variables:"/>
        </Bold>
        <LineBreak/>
        <Run Text="    When a Compiler instance Compile method is called, several processes occur:"/>
        <LineBreak/>
        <Run Text="        . Verifies that an expression was passed;"/>
        <LineBreak/>
        <Run Text="        . Verifies it's well written;"/>
        <LineBreak/>
        <Run Text="        . Verifies that the levels nesting if correct;"/>
        <LineBreak/>
        <Run Text="        . Verifies that a valid function call tree can be built, according to the functions and their signatures;"/>
        <LineBreak/>
        <Run Text="        . Etc."/>
        <LineBreak/>
        <Run Text="    And if it's all well, an Expression instance is returned to you that itself enables you to:"/>
        <LineBreak/>
        <Run Text="        . Call the Solve method to solve the expression;"/>
        <LineBreak/>
        <Run Text="        . See the RootToken property that allows you to step into the whole function call tree leafs."/>
        <LineBreak/>
        <Run Text="    This tool also supports the notion of variables, that is you can write something as &quot;a+b&quot; and let the system handle it. Well, in fact no, you must write it down as &quot;$a+$b&quot; , as every variable name must be prefixed with $ ." />
        <LineBreak/>
        <Run Text="    When you call Compile and the system sees variables in the expression, the system raises an event called ExpressionVariablesTypesRequest, which you must handle, and there you must examine the variables found and state their data types."/>
        <LineBreak/>
        <Run Text="    After the event ends and the control passes back to the tool, it analyzes the types and determines if a valid tree is possible to build. If not, an exception is throwed, of course! If yes, a normal Expression instance is returned."/>
        <LineBreak/>
        <Run Text="    Last but not least, when variables exist, you must, prior to calling Solve, fill in the variables values in the Expression instance Variables array. And that's all."/>
        <LineBreak/>
        <LineBreak/>
        <Run Text="Finally, let me just state that this tool is not a work in progress, it's final, tested and re-tested."/>
        <LineBreak/>
        <Run Text="It should work!"/>
        <LineBreak/>
        <Run Text="Still I'm open for fresh ideas on improving this tool. Please use the links below for that."/>
        <LineBreak/>
        <LineBreak/>
        <Run FontSize="22" Text="ENJOY!"/>
      </TextBlock>
    </ScrollViewer>
  </Grid>
</UserControl>